<?php

defined('IN_DESTOON') or exit('Access Denied');
$menus = array (
    array('在线融资管理', '?file='.$file),

);
$table = $DT_PRE.'zxrz';
$_status = array('未审核','审核成功');
switch($action) {
	case 'edit':
		if($submit) {
			
			
			$db->get_one("update {$table} set status=$status,ausername='".$_username."',atime=".time()." where id=".$id);
			dmsg('审核成功', '?file='.$file);
		} else {
			$v = $db->get_one("SELECT * FROM {$table} where id=".$id);
			
			include tpl('zxrz_edit');
		}
	break;
	case 'delete':
		if($id) {
			$v = $db->get_one("SELECT * FROM {$table} where id=".$id);
			$db->query("delete from {$table}  where id=".$id);
			$file2 =  str_replace(DT_PATH,'',$v["thumb"]);
			//unlink("$file2");
			dmsg('', '?file='.$file);
		} else {
			
		}
	break;
	default:
		$lists = array();
		$pages = pages($db->count($table, $condition), $page, $pagesize);
		$result = $db->query("SELECT * FROM {$table} ORDER BY ID DESC LIMIT $offset,$pagesize");
		while($r = $db->fetch_array($result)) {
			$lists[$r['id']] = $r;
		}
		include tpl('zxrz');
	break;
}
?>